//
//  ZixunModel.swift
//  YunshuApp
//
//  Created by 周文杰 on 2017/5/21.
//  Copyright © 2017年 zwj. All rights reserved.
//

import UIKit
import HandyJSON

class ZixunModel: NSObject,HandyJSON {

//    static let List_ID_SHICHANGGUANCHA = "3";
    static let List_ID_CHANGSHANGJIAGE = "4"; //厂商价格
//    static let List_ID_SHICHANGHANGQING = "5"; //市场行情
    static let List_ID_REDIANZIXUN = "2"; //热点资讯
    
    var modelId = "" //    @JsonProperty("id")

    
    var imageUrl = "" //ext
    var title = ""
    
    var favourateCount = 0 //praiseNum
    var createtime = ""
    var type = ""
    
    override required init() {
        
    }
    
    func mapping(mapper: HelpingMapper) {
        mapper.specify(property:&modelId, name: "id")
        mapper.specify(property:&imageUrl, name: "ext")
        mapper.specify(property:&favourateCount,name: "praiseNum")
    }

    func getTime() -> String{
        
        let millionSeconds:Double = Double(self.createtime)!
        let date2 = Date.init(timeIntervalSince1970: TimeInterval( millionSeconds/1000) )
        let formatter = DateFormatter.init()
        formatter.dateFormat = "YYYY-MM-dd HH:mm"
        return formatter.string(from: date2)
    }
    
}
